#pragma once  //!防止头文件被重复包含
#include "ti_msp_dl_config.h"
#include "Lib.h"
#include <stdio.h>

#define u8     uint8_t

#define IR_I2C_ADDR 0x12

struct huiduo
{
    uint8_t x1 ;
    uint8_t x2 ;
    uint8_t x3 ;
    uint8_t x4 ;
    uint8_t x5 ;
    uint8_t x6 ;
    uint8_t x7 ;
    uint8_t x8 ;
};

// 计数结构体（记录全白到黑的次数）
struct transition_counter 
{
    uint32_t count;  // 全白到黑的次数
};


extern struct huiduo Huiduo ;
extern struct transition_counter counter;

void IRI2C_WriteByte(uint8_t addr, uint8_t dat);
uint8_t IRI2C_ReadByte(uint8_t addr);
void deal_IRdata();
void Huidu_Init(void);
void Check_WB_BW(void) ;
